<div class="ajaxLoading">
<img src='<?php echo $engineReturn['admin_template']?>css/images/loading.gif' width="50" align="middle" />
</div>
<div class='ajaxGrid'>
<?php
	$res	= $engineReturn['record']['records'];
//	echo "<pre>";
//	print_r($res);
	if(count($res)>0)
	{
		echo "<table class='table'>";
		echo "<tr>";
			echo "<th colspan='2'>";
			echo "</th>";
			echo "<th>Parameter</th>";
			echo "<th>Value</th>";
		echo "</tr>";
		for($i = 0; $i<count($res); $i++)
		{
			$id	= $res[$i][$engineReturn['record']['fieldSetting'][0]['name']];

			if (is_array($id))
			{
				$id = $id['idRec'];
			}
//			echo "</br>";
				echo "<tr>";
				echo "<td>";
				echo "<a idrec='$id' title='Press Here to Edit Data' href='".$baseUrlSave.$otority."/engine/".$engineReturn['modulename']."/normal/insert_cross/".$res[$i]['fid']."'>";
						echo "<img src='".$engineReturn['admin_template']."css/images/edit.png' />";
					echo "</a>";
				echo "</td>";
				echo "<td>".($i+1)."</td>";
				foreach($engineReturn['record']['fieldSetting'] as $v)
				{
					$fieldName	= $v['name'];
					if($res[$i]['fid']==$v['idvalue'])
					{
						echo "<td>".$v['text']."</td>";
						echo "<td>";
						switch($v['input'])
						{
							case "text":
							case "text_area":
								echo $res[$i][$fieldName];
							break;
							case "image":
								if($res[$i][$fieldName]!="")
									echo "<div class='defContainerImage'>"
										."<img src='".$res[$i][$fieldName]."'>"
										."</div>";
							break;
							case "radio":
							case "select":
								if(isset($res[$i][$fieldName][1]))
									echo $res[$i][$fieldName][1];
								else
									echo $res[$i][$fieldName][0];
							break;
							case "simple_table":
													if(isset($res[$i][$fieldName]['dataRec']))
														echo $res[$i][$fieldName]['dataRec'];
													else
														echo "-";
							break;
						}
						echo "</td>";
					}
				}
			echo "</tr>";
		}
	echo "</table>";
	}
	?>
</div>
<script type="text/javascript">
	$('.ajaxGrid').delay(100).slideDown('slow', function(){
			$('.ajaxLoading').slideUp('slow');
	});
</script>